from config import HOST
from utils import GetLog
log = GetLog.get_logger()


class ApiTender:

    def __init__(self, session):
        self.session = session
        self.__url_tender = HOST + '/trust/trust/tender'

    def api_tender(self, amount):
        data = {
            "id": 642,
            "depositCertificate": "-1",
            "amount": amount,
            "password": ""
        }
        log.info('正在调用投资接口，请求方法：{}, 请求url: {}, 请求参数：{}'.format("post", self.__url_tender, data))
        return self.session.post(url=self.__url_tender, data=data)